#ifndef __StateMmanager_H__
#define __StateMmanager_H__

#include <vector>
#include "../Header.h"
#include "Device.h"
#include "State.h"

class StateManager
{
private:
	std::vector<State*> m_StaticStateList;
	State* m_CurrentState;
	State* m_PrevState;
	State* m_NextState;
	__bool_ m_IsDeleteOldState;
protected:
	static StateManager* m_Instance;
protected:
	StateManager();
	~StateManager();
public:
	static StateManager* GetInstance()
	{
		if (!m_Instance)
		{
			m_Instance = new StateManager();
		}
		return m_Instance;
	}

	static void DestroyInstance()
	{
		if (m_Instance)
			SAFE_DELETE(m_Instance);
	}
	void Update(__float_, __bool_);
	void AddState(State*);
	void SwitchState(State*);
	State* GetState(__int32_ idx){ return m_StaticStateList.at(idx); }
};

#endif